package com.shure.surdes.common.exception;

import com.shure.surdes.common.result.R;
import lombok.Data;

/**
 * @ClassName GlobalException
 * @Description 统一异常处理类
 * @Author shure
 * @Date 2023/3/17 09:32
 * @Version 1.0
 **/
@Data
public class ServeException extends RuntimeException {

    private R codeMsg;

    public ServeException(R codeMsg) {
        super(codeMsg.getMsg());
        this.codeMsg = codeMsg;
    }

    public ServeException(String msg) {
        super(msg);
        this.codeMsg = new R(R.SERVER_ERROR.getCode(), msg);
    }

}
